#!/bin/bash
 
#sync_devcloud.sh
#描述：同步到其他服务器
 
all_ip=$*
 
for _ip in ${all_ip[@]}
do
        echo "同步程序到"${_ip}
        ssh  root@${_ip} "mkdir -p /etc/docker/certs.d/"
 
        scp -rq /etc/docker/certs.d/mitadocker.oa.com\:5000 root@${_ip}:/etc/docker/certs.d/
 
        scp -drq /etc/docker/certs.d/bk.artifactory.oa.com\:8090 root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/bk.artifactory.oa.com\:8080 root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/bk.artifactory.oa.com\:8443 root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/dev.artifactory.oa.com\:8090 root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/dev.artifactory.oa.com\:8080 root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/dev.artifactory.oa.com\:8443 root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/test.artifactory.oa.com\:8443 root@${_ip}:/etc/docker/certs.d/
 
        scp -drq /etc/docker/certs.d/hub.oa.com root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/docker.oa.com root@${_ip}:/etc/docker/certs.d/
        scp -drq /etc/docker/certs.d/registry.oa.com root@${_ip}:/etc/docker/certs.d/
        echo "同步完成"
done